GtkPlacesSidebar: Don't show desktop if its home
authorMatthias Clasen <mclasen@redhat.com>
Thu, 19 Dec 2013 16:22:02 +0000 (11:22 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 19 Dec 2013 16:22:02 +0000 (11:22 -0500)
We go to extra length to set the desktop_uri to NULL when
desktop == home, but then we were adding the (non-functional)
place item anyway. Don't do that.

gtk/gtkplacessidebar.c

index 979700fb9812b2d3d325a100332eb988d0c875fb..9562dd8e7675709516ce31c294b2d893026484ff 100644 (file)
@@ -838,14 +838,17 @@ update_places (GtkPlacesSidebar *sidebar)
   if (sidebar->show_desktop)
     {
       mount_uri = get_desktop_directory_uri ();
-      icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_DESKTOP);
-      add_place (sidebar, PLACES_BUILT_IN,
-                 SECTION_COMPUTER,
-                 _("Desktop"), icon, mount_uri,
-                 NULL, NULL, NULL, 0,
-                 _("Open the contents of your desktop in a folder"));
-      g_object_unref (icon);
-      g_free (mount_uri);
+      if (mount_uri)
+        {
+          icon = g_themed_icon_new_with_default_fallbacks (ICON_NAME_DESKTOP);
+          add_place (sidebar, PLACES_BUILT_IN,
+                     SECTION_COMPUTER,
+                     _("Desktop"), icon, mount_uri,
+                     NULL, NULL, NULL, 0,
+                     _("Open the contents of your desktop in a folder"));
+          g_object_unref (icon);
+          g_free (mount_uri);
+        }
     }
 
   /* XDG directories */